/*
 * Copyright 2008 Carnegie Mellon University
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.cmu.lti.sepia.infra.topic.model;

import java.util.ArrayList;
import java.util.List;

public class Topic {

  private int internalId;

  private String externalId;
  
  private String answerType;

  private String questionSrc;

  private String questionTrg;

  private String narrativeSrc;

  private String narrativeTrg;

  private String note;

  private String title;

  private boolean done;

  private List<Answer> answers;

  private List<Nugget> nuggets;

	public Topic( int topicId, String externalId, String answerType, 
			String questionSrc, String questionTrg,
			String narrativeSrc, String narrativeTrg,
			String note, String title ) {
		this.internalId = topicId;
		this.externalId = externalId;
		this.answerType = answerType;
		this.questionSrc = questionSrc;
		this.questionTrg = questionTrg;
		this.narrativeSrc = narrativeSrc;
		this.narrativeTrg = narrativeTrg;
		this.note = note;
		this.title = title;
	}
	
	/**
	 * @return the internalId
	 */
	public int getTopicId() {
		return internalId;
	}

	/**
	 * @return the answerType
	 */
	public String getAnswerType() {
		return answerType!=null ? answerType : "";
	}

	/**
	 * @return the questionSrc
	 */
	public String getQuestionSrc() {
	  return questionSrc!=null ? questionSrc : "";
	}

	/**
	 * @return the questionTrg
	 */
	public String getQuestionTrg() {
    return questionTrg!=null ? questionTrg : "";
	}

	/**
	 * @return the narrativeSrc
	 */
	public String getNarrativeSrc() {
    return narrativeSrc!=null ? narrativeSrc : "";
	}

	/**
	 * @return the narrativeTrg
	 */
	public String getNarrativeTrg() {
    return narrativeTrg!=null ? narrativeTrg : "";
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
    return title!=null ? title : "";
	}

	/**
	 * @return the done
	 */
	public boolean isDone() {
		return done;
	}

	/**
	 * @param done the done to set
	 */
	public void setDone(boolean done) {
		this.done = done;
	}

	/**
	 * @return the note
	 */
	public String getNote() {
    return note!=null ? note : "";
	}

	/**
	 * @return the answers
	 */
	public List<Answer> getAnswers() {
    return answers!=null ? answers : new ArrayList<Answer>();
	}

	/**
	 * @param answers the answers to set
	 */
	public void setAnswers(List<Answer> answers) {
		this.answers = answers;
	}

	/**
	 * @return the nuggets
	 */
	public List<Nugget> getNuggets() {
    return nuggets!=null ? nuggets : new ArrayList<Nugget>();
	}

	/**
	 * @param nuggets the nuggets to set
	 */
	public void setNuggets(List<Nugget> nuggets) {
		this.nuggets = nuggets;
	}

  /**
   * @return the externalId
   */
  public String getExternalId() {
    return externalId!=null ? externalId : "";
  }

  /**
   * @param externalId the externalId to set
   */
  public void setExternalId(String externalId) {
    this.externalId = externalId;
  }

  /**
   * @param questionTrg the questionTrg to set
   */
  public void setQuestionTrg(String questionTrg) {
    this.questionTrg = questionTrg;
  }

  /**
   * @param answerType the answerType to set
   */
  public void setAnswerType(String answerType) {
    this.answerType = answerType;
  }

  /**
   * @param questionSrc the questionSrc to set
   */
  public void setQuestionSrc(String questionSrc) {
    this.questionSrc = questionSrc;
  }

  /**
   * @param narrativeSrc the narrativeSrc to set
   */
  public void setNarrativeSrc(String narrativeSrc) {
    this.narrativeSrc = narrativeSrc;
  }

  /**
   * @param narrativeTrg the narrativeTrg to set
   */
  public void setNarrativeTrg(String narrativeTrg) {
    this.narrativeTrg = narrativeTrg;
  }

  /**
   * @param note the note to set
   */
  public void setNote(String note) {
    this.note = note;
  }

  /**
   * @param title the title to set
   */
  public void setTitle(String title) {
    this.title = title;
  }

  /* (non-Javadoc)
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    return "Topic [internalId=" + internalId + ", externalId=" + externalId + ", answerType="
            + answerType + ", questionSrc=" + questionSrc + ", questionTrg=" + questionTrg
            + ", narrativeSrc=" + narrativeSrc + ", narrativeTrg=" + narrativeTrg + ", note="
            + note + ", title=" + title + ", done=" + done + ", answers=" + answers + ", nuggets="
            + nuggets + "]";
  }

}
